package com.mywebsite.core.client.dashboard.activity;

import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.inject.ImplementedBy;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.mywebsite.core.client.dashboard.place.DashboardPlace;
import com.mywebsite.core.client.dashboard.ui.DashboardView;

@Singleton
public class DashboardActivity extends AbstractActivity {
    @ImplementedBy(DashboardView.class)
	public interface DashboardDisplay extends IsWidget{
	    public void init(String placeName);
	}
	@Inject
	private DashboardDisplay display;

	public void start(AcceptsOneWidget panel, EventBus eventBus) {
		panel.setWidget(display.asWidget());
	}
	
	public void init(DashboardPlace dashboardPlace) {
		display.init(dashboardPlace.getPlaceName());
	}
}
